package hku.cs.lunuo.cost;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class Change {
	public static void main(String[] args) throws IOException {
		File f = new File(args[0]);

		BufferedReader br = new BufferedReader(new FileReader(f));

		String s = br.readLine();
		int i = 1; int totalLine = 0; float faultRadio=0; float esLength = -1;
		while(s != null){
			String[] xx = s.split(" ");
			String[] yy;
			if(i%25 == 1){
				yy = xx[4].split("=");
				faultRadio = Float.valueOf(yy[1]);
//				if(faultRadio-1<0.00001&&faultRadio-1>-0.00001){
//					i+=25;
//					int z = 25;
//					while(z!=0){s = br.readLine();z--;}
//					continue;
//				}
				
				if(Float.valueOf(xx[2].split("=")[1])<0){
					i+=25;
					int z = 25;
					while(z!=0){s = br.readLine();z--;}
					continue;
				}
				System.out.print(esLength + "\t");
				esLength = -1;
				System.out.println();
				System.out.print(yy[1] + "\t");
				yy = xx[3].split("=");
				totalLine = Integer.valueOf(yy[1]);
			}	
			
			if(!(xx[6].split("=")[1].equals("NOTKBC")||xx[6].split("=")[1].equals("NaN")) && esLength<0)
				esLength =  Float.valueOf(xx[6].split("=")[1]);
			
						
//			yy = xx[2].split("=");
//			float exxx = Integer.valueOf(yy[1])/(float)totalLine;
//			if(exxx>1)
//				exxx=1;
			yy = xx[1].split("=");
			float exxx = Float.valueOf(yy[1]);
			System.out.print(exxx + "\t");
			s = br.readLine();
			i++;
		}
		System.out.print(esLength + "\t");
		
//		int i = 1; int totalLine = 0; float faultRadio=0;
//		while(s != null){
//			String[] xx = s.split(" ");
//			String[] yy;
//			if(i%17 == 1){
//				yy = xx[4].split("=");
//				faultRadio = Float.valueOf(yy[1]);
//				
//				System.out.println();
//				System.out.print(faultRadio + " ");
//				yy = xx[3].split("=");
//				totalLine = Integer.valueOf(yy[1]);
//				s = br.readLine();
//				i++;
//				continue;
//			}				
//						
//			yy = xx[2].split("=");
//			System.out.print(Integer.valueOf(yy[1])/(float)totalLine + " ");
//			s = br.readLine();
//			i++;
//		}

	}
}
